<template>
  <a-card class="info" title="员工考勤日报表">
      <template slot="extra">
        <a-button
            class="ruleButton"
            :ghost="true"
            type="primary"
            icon="edit"
            @click="handleEdit(model)"
            :disabled="isDisabledAuth('erpEmployeeAttendanceDay:edit')"
        />
      </template>
     <a-row type="flex"  justify="center">
       <a-col :span="24">
          <erp-employee-attendance-day-form ref="realForm" :disabled="true" normal></erp-employee-attendance-day-form>
       </a-col>
     </a-row>
     <erp-employee-attendance-day-modal ref="modalForm" @ok="modalFormOk"></erp-employee-attendance-day-modal>
  </a-card>
</template>

<script>

  import { getAction } from '@/api/manage'
  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  import ErpEmployeeAttendanceDayForm from './modules/ErpEmployeeAttendanceDayForm'
  import ErpEmployeeAttendanceDayModal from './modules/ErpEmployeeAttendanceDayModal'
  import {DisabledAuthFilterMixin} from '@/mixins/DisabledAuthFilterMixin'

  export default {
    name: 'ErpEmployeeAttendanceDayDetail',
    mixins: [JeecgListMixin, DisabledAuthFilterMixin],
    components: {
     ErpEmployeeAttendanceDayForm,
     ErpEmployeeAttendanceDayModal,
    },
    data () {
      return {
         model: {},
        id: '',
        url: {
          queryById: "/api/erp/hr/attendance/erpEmployeeAttendanceDay/queryById",
          delete: "/api/erp/hr/attendance/erpEmployeeAttendanceDay/delete",
        },
        confirmLoading: false,
        iconStyle:{"font-size":"20px"},
      }
    },
    created() {
    },
    watch: {
      $route(to, from) {
        this.loadData();
      },
    },
    mounted() {
    },
    methods: {
      loadData() {
        const id = this.$route.params.id;
        getAction(this.url.queryById, { id }).then((res) => {
          if (res.success) {
            const model = res.result
            this.$refs.realForm.edit(model);
            this.model=model;
          }
        })
      },
    }
  }
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';

.info {
  /deep/ .ant-card-head-title{
    flex: none;
    margin-right: 20px;
  }
  /deep/ .ant-card-extra{
    flex: 1;
    float: left;
  }
}
</style>
